/**
 * 
 */
package com.dp.behav.command;

/**
 * @author Sunaina.Sharma
 * 
 */
public class RemoteControl {
	Command[] onCommands;
	Command[] offCommands;

	RemoteControl() {
		onCommands = new Command[7];
		offCommands = new Command[7];
		Command noCommand = new NoCommand();
		for (int i = 0; i < 7; i++) {
			onCommands[i] = noCommand;
			offCommands[i] = noCommand;
		}
	}

	/**
	 * @param slot
	 * @param onCommand
	 * @param offCommand
	 */
	public void setCommand(int slot, Command onCommand, Command offCommand) {
		onCommands[slot] = onCommand;
		offCommands[slot] = offCommand;
	}

	/**
	 * @param slot
	 */
	public void onButtonWasPushed(int slot) {
		onCommands[slot].execute();
	}

	/**
	 * @param slot
	 */
	public void offButtonWasPushed(int slot) {
		offCommands[slot].execute();
	}
}
